<?php  //require_once("../include/isload.php");
require_once("../include/conn.php");
if(!empty($_REQUEST["name"])){
	$nname=$_REQUEST["name"];
	if($_REQUEST["action"] == "add")
	{	
		$title=$_REQUEST["title"];
		$tdate=$_REQUEST["tdate"];
		$content=$_REQUEST["content"];
		$file = $_FILES["uploadfile"]["tmp_name"];
		
		
		switch ($nname){
		case  "3":
		$sql_add="INSERT INTO `$tb_dt` ( `id` , `title` , `author` , `content`, `tdate` ) VALUES (null, '$title', '综合管理部 ', '$content', '$tdate')";
		break;
		case  "4":
		$sql_add="INSERT INTO `$tb_rw` ( `id` , `title` , `author` , `content`, `tdate` ) VALUES (null, '$title', '综合管理部 ', '$content', '$tdate')";
		
		break;
		case  "6":
		$sql_add="INSERT INTO `$tb_dz` ( `id` , `title` , `author` , `content`, `tdate` ) VALUES (null, '$title', '综合管理部 ', '$content', '$tdate')";
	}
		$cn_add = mysql_query($sql_add);
		$id = mysql_insert_id();
		?>
		<script language="JavaScript" type="text/JavaScript">
		alert("添加成功!");
		</script>
		<?	
		echo "<script language='javascript'>";
		if($nname==3){
		echo "self.location="."'"."admin_dtxx.php'";
		}
		else if($nname==4){	
		echo "self.location="."'"."admin_rwzb.php'";
		}
		else if($nname==6){	
		echo "self.location="."'"."admin_dzgg.php'";
		}
		echo "</script>";		
		}
}
else{


?>
<meta http-equiv="refresh" content="0;URL=admin_index.php">
<?php }?>

